<?php $this->beginClip('pagetitle'); ?>支付<?php $this->endClip(); ?>

<?php $this->renderPartial('/template/payLoading')?>

<script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.inc.min.js"></script>
<script>


    easyloading('show');
    //业务逻辑
    $(document).ready(function(){
        setTimeout(function(){
            easyloading('hide');
            ap.tradePay({
                tradeNO: '<?= $trade_no?>'
            }, function(res){
                if(res.resultCode == '9000'){
                    showMsg('支付成功',{position:'center'});
                    setTimeout(function(){
                        window.location.href = '<?php echo $callback_url?>';
                    }, 500);
                }else{
                    ap.alert(res.resultCode);
                }
            });
        }, 1000);

    });
</script>